﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MethodWorx.CMS.Content;
using MethodWorx.CMS.UI.Models.Shared;
using System.Web.Mvc;
using MethodWorx.CMS.UI.Application;
using MethodWorx.CMS.Services;
using MethodWorx.CMS.Requests;

namespace MethodWorx.CMS.UI.Models
{
    public class ConfigureContentTemplateModel
    {
        private ContentTemplateService service;
        public ContentTemplateBasicDetailsRequest UpdateRequest { get; private set; }

        public ConfigureContentTemplateModel(ContentTemplateService service, Guid id)
        {
            //  create the update reuqest
            this.UpdateRequest = new UpdateContentTemplateBasicDetailsRequest(service, id);
            //  ensure its valid
            if(this.UpdateRequest == null)
                throw new WebException("Content Template Not Found");
        }

        public ConfigureContentTemplateModel(ContentTemplateBasicDetailsRequest basicDetails)
        {
            this.UpdateRequest = basicDetails;
        }
    }
}